import Vue from 'vue';
import Vuex from 'vuex';
import user from './module/user';
import over from './module/over';
import menu from './module/menu';
import order from './module/order';
import blog from './module/blog';
Vue.use(Vuex);
const store = () => {
  return new Vuex.Store({
    state: {
      isMobile: true, //当前是否在移动端,包含各种平板都算移动端,在中间件计算
      isLogin: false, //当前是否登陆
      inHome: true, //当前路由是否在首页
      pageTitle: "Miss Yeah", //当前页面标题
      isHideMoTitle: false, //是否隐藏移动端标题栏
      overLoading: true, //全局loading
      navList: [], //导航列表
    },
    mutations: {
      setIsmobile(state, data) {
        state.isMobile = data;
      },
      setInHome(state, data) {
        state.inHome = data;
      },
      setPageTitle(state, data) {
        state.pageTitle = data;
      },
      setHideMoTitle(state, data) {
        state.isHideMoTitle = data;
      },
      setLoding(state, data) {
        state.overLoading = data;
      },
      setNavList(state, data) {
        state.navList = data;
      },
    },
    modules: {
      user,
      over,
      menu,
      order,
      blog
    }
  })
}
export default store;
